// 导入请求对象
import request from '@/utils/request'

// 封装一个获取部门列表的接口
export const getDepts = () => {
  return request({
    url: '/company/department'
  })
}
export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}

// 封装一个删除部门的接口
export const delDepts = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 封装一个新增部门的接口
export const addDepts = (data) => {
  return request({
    url: `/company/department`,
    method: 'post',
    data
  })
}

// 封装一个根据id获取部门详情的接口
export const deptsDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

// 封装一个根据id修改部门详情的接口
export const editDepts = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

